/**
 * Setvor project
 */
package setvor.npc.test;

import static org.junit.Assert.*;

import java.io.*;
import java.io.IOException;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import setvor.npc.*;
import setvor.npc.generator.NativeStubsGenerator;

/**
 * @author julatec
 *
 */
public class TypeMapperTestCase {

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
	}

	/**
	 * Test method for {@link setvor.npc.generator.TypeMapper#get(java.lang.Class)}.
	 */
	@SuppressWarnings("unchecked")
	@Test
	public final void testGet() {
		
		Class<? extends NativeWriteable>[] testClasses = (Class<? extends NativeWriteable>[]) new Class<?>[]{
//				void.class,
				
//				// Basic type
//				char.class,
//				byte.class, 
//				short.class, 
//				int.class, 
//				long.class, 
//				float.class,
//				double.class, 
//				boolean.class, 
//				
//				// Basic array type
//				char[].class,
//				byte[].class,
//				short[].class,
//				int[].class,
//				long[].class,
//				float[].class,
//				double[].class,
//				boolean[].class,
//				
//				// String types
//				String.class,
//				String[].class,
//				
//				// Object types
//				Object.class,
//				Object[].class,
//				
//				// Exception types
//				Throwable.class,
//				NativeException.class,
				
				SympleNativeClass.class,
				SympleNativeEnum.class,
				SympleNativeException.class
				
//				SympleNativeClass[].class,
//				SympleNativeEnum[].class,
//				SympleNativeException[].class
		};
		
		File output = new File("src");
		File classpath = new File("bin");
		
		for(Class<? extends NativeWriteable> clazz : testClasses){
			try {
				NativeStubsGenerator.GenerateFiles(clazz, classpath, output);
			} catch (SecurityException e) {
				e.printStackTrace();
				fail(e.getMessage());
			} catch (IOException e) {
				e.printStackTrace();
				fail(e.getMessage());
			} catch (NoSuchMethodException e) {
				e.printStackTrace();
				fail(e.getMessage());
			}
		}
		

		
		
		assertTrue(true);
		
	}

}
